package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author jerry
 * @Company 极客营
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117621328";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCsblZecABTRukV1ISuq0HKsus5MarMtwL3PFxuuCWKUM0Ew6YGioeRztZE20leuNms4FNgdJ70+AW5xhIm3lQ41ulMJMSrZ6QgF3m15rf29oR5wqsraq/kH92nWMe2+oP3kdfb2N3Vk8J8BxqDaU08OwXqTzGC/Y9nDf1B10hlnpGxElww3cOowtoKfkQ/wzrWVThqMHF4Uj/PZ72M72VvqkgQbQ827LeSclhM9Qh7KSo4X2OEVbl6djTj+Ykrp+oWz4tASdzsDIZtIBmr8+SrSjHtcMXLWqPxsZ9I9zPZ7H5XUwd7WPPkdt/fpYJee3lXqyzOf8+YYKo3YeftAOzpAgMBAAECggEAHD83BuFyLDJBnMHjunlznbERt5zbTg3s/nN08O5Zt/7klxM173xiGRC5KS6DJnFBt4BIKFTydU7sITLBZnylb2pFbaPYU/v2dwthdNsG5/4aVZf+Um53wfc2aGOy09bWJ4hMxEcSkBpUkdzYCw8FCAjjPy8Z/UtsYoV4J4EM6xh5kUHeWiXXubPrGTmXDlT3JYvyqLXwPzAYEeLS2jPpqqY7nOPAHRFFXYhuRjpVfmTNOfMyLa6j+8DEuR+wFDY8xV+9k7I2/VfG9m3jotFIXh6sEx1vaAhaPNZAK76zlERIQ74g0whuR2DxrUfsVvcWdH6BZY07wAu3aYbggZhzwQKBgQDsxgaonOFnx4wKRf0tKCkrwydhbhfKPh5W16b3wcySymtZfQLYE1UTZRZqFbA3x+SjbVi+91fbbGIqEqNVWowHXYM4QVLmiPD9fQgy89zJc5Q+keaEjZe+Gn9vV/L8b6nRGUv9LuBYaF9IL0jxiRmNcI12iut82zZzayo+LNdjYwKBgQC6bsdrLyoYvjfXd1NNFENSvB5iIOYUOEl7zkoBw1gktOP7F2+gzPRK7hROAmnsuYIOQzHYzE3yaMRLDwmtz26m7gf2NGHqMGUQzUJkOO1BAJqenhROFSKa8F1e0iPmFJzMVeksOe/96+VlwIm8vB7V4UZk50jATNHnsrJF+MuOQwKBgQCNyfCG3JunGDpmlI8OkbRF/rIAiHs6o4RroOzeBXJKnWk3x8MCPmF+IdUQZjiGzu++Zmb0xQ4Z2ofWhh7FqFmet4MzFvtcDrmyM0PLr3mSMeKeraSL0HcEYr3ZoaNjREM/cpSs43t5tdcJVTerXNyudK5iRMLMnEG5UH2ViijZ3QKBgQCZjzeo3I9jFALw8fNmMMOHOTYZg5mfnAFC/dbNfvZyPaDvKA2lOEwcD+AfpTNUbjRmxQgg1594hLzySi+hv5MX4kYikGD6QeRtI3SFErKxcOrqrbBx5Ey9rDBsMtCo6d+BG15VNF+uGgi4eA+7qoQHjWerIyo0YtIec30Nz3Dy+wKBgQDIY4EM8SMnV7nRRU+e1NlvoTBzSwFCIdxEew9rdZzwYMCVAgOVNweDMsnYtSA1p9nXhqGWGtVLfOq3+2WA/NCyDwKu0vD2MhofK0B4JxMiDQH5x8WuHjBFiNkBv8mAAA74bmPCBz46N3W9yqFqgTq+SBxxt8pzW6cyvQUeSwaqCw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjQ3WUdetUwlEPdFEOsff0L1Fzbl76SXEQ/M6NJxXxKl51ez/TgAk328XZmCRwScJDYuyy5Dic3v4+VRZJ4Cq3RZl1yHWJsscMsLWgRMIATC94u1LEgrAjYmgmtZ7sWmBmjO7T7IcqxnuKbRjCOzk1Ehu6CCRp23Bz/Pc8NYQM1BIQMPQZqwtMY5/cJEyFSTZKTvTwF/1NyG5Y/GCgsz9JcfvGsaEbTCRoLqq0cEcmilfj48/9zK5TbGJAFKvg+rP2x7Oyjs/RErT2mKM/ofUbQ+9icQAwhpZF/mXJidOpUxZHE4vQb/cANgjjZpNLq609sdX6l/mJiSOP1Jq+3clVQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8899/igeekShop/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
